include $(BASEDIR)/arch/$(TARGET_ARCH)/Rules.mk
+ifneq ($(debug),y)
+CFLAGS += -DNDEBUG
+endif
+
+ifeq ($(nperfc),y)
+CFLAGS += -DNPERFC
+endif
+
ifeq ($(nodev),y)
CFLAGS += -DNO_DEVICES_IN_XEN
CFLAGS := $(subst -Werror,,$(CFLAGS))
LOAD_BASE := 0x00100000
CFLAGS := -nostdinc -fno-builtin -fno-common -fno-strict-aliasing -O3
CFLAGS += -iwithprefix include -Wall -Werror -DMONITOR_BASE=$(MONITOR_BASE)
-CFLAGS += -fomit-frame-pointer -I$(BASEDIR)/include -D__KERNEL__ -DNDEBUG
-#CFLAGS += -fomit-frame-pointer -I$(BASEDIR)/include -D__KERNEL__
+CFLAGS += -fomit-frame-pointer -I$(BASEDIR)/include -D__KERNEL__
CFLAGS += -Wno-pointer-arith -Wredundant-decls -m32
TARGET_CPU := i686
CFLAGS += -march=$(TARGET_CPU)
* handled by some other CPU. (or is disabled)
*/
int irq = regs.orig_eax & 0xff; /* high bits used in ret_from_ code */
- int cpu = smp_processor_id();
irq_desc_t *desc = irq_desc + irq;
struct irqaction * action;
unsigned int status;
- u32 cc_start, cc_end;
+#ifndef NPERFC
+ int cpu = smp_processor_id();
+ u32 cc_start, cc_end;
perfc_incra(irqs, cpu);
rdtscl(cc_start);
+#endif
spin_lock(&desc->lock);
desc->handler->ack(irq);
desc->handler->end(irq);
spin_unlock(&desc->lock);
+#ifndef NPERFC
rdtscl(cc_end);
if ( !action || (!(action->flags & SA_NOPROFILE)) )
printk("Long interrupt %08x -> %08x\n", cc_start, cc_end);
#endif
}
+#endif /* NPERFC */
return 1;
}
include $(BASEDIR)/Rules.mk
+ifeq ($(nperfc),y)
+OBJS := $(subst perfc.o,,$(OBJS))
+endif
+
default: $(OBJS)
$(LD) $(LDARCHFLAGS) -r -o common.o $(OBJS)
read_unlock_irqrestore(&tasklist_lock, flags);
}
-extern void perfc_printall (u_char key, void *dev_id, struct pt_regs *regs);
-extern void perfc_reset (u_char key, void *dev_id, struct pt_regs *regs);
extern void dump_runq(u_char key, void *dev_id, struct pt_regs *regs);
extern void print_sched_histo(u_char key, void *dev_id, struct pt_regs *regs);
extern void reset_sched_histo(u_char key, void *dev_id, struct pt_regs *regs);
+#ifndef NPERFC
+extern void perfc_printall (u_char key, void *dev_id, struct pt_regs *regs);
+extern void perfc_reset (u_char key, void *dev_id, struct pt_regs *regs);
+#endif
#ifndef NDEBUG
void reaudit_pages(u_char key, void *dev_id, struct pt_regs *regs);
void audit_all_pages(u_char key, void *dev_id, struct pt_regs *regs);
add_key_handler('h', show_handlers, "show this message");
add_key_handler('l', print_sched_histo, "print sched latency histogram");
add_key_handler('L', reset_sched_histo, "reset sched latency histogram");
- add_key_handler('p', perfc_printall, "print performance counters");
- add_key_handler('P', perfc_reset, "reset performance counters");
add_key_handler('q', do_task_queues, "dump task queues + guest state");
add_key_handler('r', dump_runq, "dump run queues");
add_key_handler('B', kill_dom0, "reboot machine gracefully");
add_key_handler('R', halt_machine, "reboot machine ungracefully");
+#ifndef NPERFC
+ add_key_handler('p', perfc_printall, "print performance counters");
+ add_key_handler('P', perfc_reset, "reset performance counters");
+#endif
#ifndef NDEBUG
add_key_handler('m', reaudit_pages, "re-audit pages");
add_key_handler('M', audit_all_pages, "audit all pages");
static int mod_l2_entry(l2_pgentry_t *, l2_pgentry_t, unsigned long);
static int mod_l1_entry(l1_pgentry_t *, l1_pgentry_t);
-/* frame table size and its size in pages */
+/* Frame table and its size in pages. */
struct pfn_info *frame_table;
unsigned long frame_table_size;
unsigned long max_page;
(get_shadow_status(¤t->mm,
page-frame_table) & PSH_shadowed) )
{
- /* using 'current-mm' is safe because page type changes only
- occur within the context of the currently running domain as
- pagetable pages can not be shared across domains. The one
- exception is when destroying a domain. However, we get away
- with this as there's no way the current domain can have this
- mfn shadowed, so we won't get here... Phew! */
-
+ /*
+ * Using 'current->mm' is safe and correct because page-table pages
+ * are not shared across domains. Updates to such pages' types are
+ * thus only done within the context of the owning domain. The one
+ * exception is when destroying a domain; however, this is not a
+ * problem as the currently-executing domain will not have this
+ * MFN shadowed, and at domain end-of-day we explicitly unshadow
+ * everything so that nothing will get left lying around.
+ */
unshadow_table( page-frame_table, type );
put_shadow_status(¤t->mm);
}
- return;
+ break;
case PGT_l2_page_table:
free_l2_table(page);
unshadow_table( page-frame_table, type );
put_shadow_status(¤t->mm);
}
- return;
+ break;
default:
BUG();
perfc_incrc(shadow_update_va_fail);
}
- check_pagetable( p, p->mm.pagetable, "va" ); /* debug */
+ check_pagetable(p, p->mm.pagetable, "va"); /* debug */
}
deferred_ops = percpu_info[cpu].deferred_ops;
#ifndef __XEN_PERFC_H__
#define __XEN_PERFC_H__
+#ifndef NPERFC
+
#include <asm/atomic.h>
/*
#define perfc_addc(x,y) atomic_add((y), &perfcounters.x[smp_processor_id()])
#define perfc_adda(x,y,z) atomic_add((z), &perfcounters.x[y])
+#else /* !NPERFC */
+
+#define perfc_value(x) ((void)0)
+#define perfc_valuec(x) ((void)0)
+#define perfc_valuea(x,y) ((void)0)
+#define perfc_set(x,v) ((void)0)
+#define perfc_setc(x,v) ((void)0)
+#define perfc_seta(x,y,v) ((void)0)
+#define perfc_incr(x) ((void)0)
+#define perfc_decr(x) ((void)0)
+#define perfc_incrc(x) ((void)0)
+#define perfc_incra(x,y) ((void)0)
+#define perfc_add(x,y) ((void)0)
+#define perfc_addc(x,y) ((void)0)
+#define perfc_adda(x,y,z) ((void)0)
+
+#endif /* !NPERFC */
+
#endif /* __XEN_PERFC_H__ */
#if SHADOW_DEBUG
-extern int check_pagetable( struct mm_struct *m, pagetable_t pt, char *s );
+extern int check_pagetable(struct mm_struct *m, pagetable_t pt, char *s);
#else
-#define check_pagetable( m, pt, s )
+#define check_pagetable(m, pt, s) ((void)0)
#endif